import axios from '../utils/axios'

//获取图书类别层级列表
export function getBookTypeListForTree(params) {
    return axios.get('/bookType/selectTree', { params })
}

//获取图书类别列表 - 分页
export function getBookTypeListForPages() {
    return axios.get('/bookType/selectByExampleAndRowBounds')
}

//获取图书类别列表
export function getBookListSelect(params) {
    return axios.get('/bookType/select', { params })
}

// 添加书类别
export function AddBookType(params) {
    return axios.post('/bookType/', params);
}

//更新图书类别
export function editBookType(params) {
    return axios.put(`/bookType/${params.id}`)
}

//删除图书类别
export function deleteBookType(params) {
    return axios.delete(`/bookType/${params.id}`)
}



// 添加书
export function AddBook(params) {
    return axios.post('/book/', params);
}

//编辑书
export function editBook(params) {
    return axios.put(`/book/${params.id}`, params)
}

//删除书
export function deleteBook(id) {
    return axios.delete(`/book/${id}`)
}

//查询书列表
export function getBookList() {
    return axios.get('/book/selectByExample')
}

//查询书列表 - 分页
export function getBookListForPages(params) {
    return axios.get('/book/selectByExampleAndRowBounds', { params })
}

// 根据id查询书详情
export function getBookInfo(params) {
    return axios.get('book/selectByKey', { params })
}